<template>
  <header class="header">
    <div class="back" v-if="back" @click="goBack"> &ltcc; </div>
    {{ title }}
  </header>
</template>

<script setup lang="ts">
import {toRef} from "vue";
import router from "@/router";


const props = defineProps({
  title: {
    type: String,
    default: "个人的threejs学习案例",
  },
  back: {
    type: Boolean,
    default: false,
  },
});
const title = toRef(props, "title");
const back = toRef(props, "back");

const goBack = () => {
  router.back();
}
</script>

<style scoped>

</style>